package com.fast.controller.system;

import com.fast.entity.SysDept;
import com.fast.services.SysDeptService;
import com.fast.utils.bean.R;
import com.fast.utils.validator.ValidatorUtils;
import com.fast.utils.validator.group.AddGroup;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 部门管理
 * Created by xiehaitao on 2017/9/9.
 */
@AllArgsConstructor
@RestController
@RequestMapping("sys/dept")
public class DeptController {


    SysDeptService sysDeptService;


    @PostMapping("/addDept")
    public R addDept(SysDept sysDept) {
        ValidatorUtils.validateEntity(sysDept, AddGroup.class);

        sysDeptService.save(sysDept);

        return R.ok();
    }












}
